//
//  ConDrawDetailViewController.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/4/5.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "ConDrawDetailViewController.h"
#import "MyCountNetwork.h"
#import "SZLAccountHelper.h"
#import "MBProgressHUD+MJ.h"
#import "UIViewController+RTRootNavigationController.h"
#import "RTRootNavigationController.h"

@interface ConDrawDetailViewController ()
@property (weak, nonatomic) IBOutlet UILabel *typeNameLab;
@property (weak, nonatomic) IBOutlet UILabel *moneyLab;
@property (weak, nonatomic) IBOutlet UILabel *timeLab;

@end

@implementation ConDrawDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"提现详情";
    self.view.backgroundColor = RGBColor(239, 239, 244);
    
    [self setNaviBar];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self getWithDrawTimer];
    });
    self.rt_disableInteractivePop = YES;//禁用手势返回
    self.moneyLab.text = [NSString stringWithFormat:@"%@元",self.count];
}
- (void)setNaviBar
{
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 30)];
    [btn setTitle:@"完成" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(saveClick) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn];
}
- (void)saveClick
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (UIBarButtonItem *)customBackItemWithTarget:(id)target
                                       action:(SEL)action
{
    return nil;
}
- (void)getWithDrawTimer
{
    NSMutableDictionary *parame = [NSMutableDictionary dictionary];
    parame[@"token"] = [SZLAccountHelper shareInstance].token;
    parame[@"id"] = @(self.ID);
    [self showWaiter];
    [MyCountNetwork withDrawTimeWithParame:parame response:^(BOOL success, NSString *msg,NSString *duration) {
        [self hideWaiter];
        if (success) {
            self.timeLab.text = duration;
        }else{
            [MBProgressHUD showError:msg];
        }
    }];
}




@end
